<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #player{
            width: 230px;
            height: 200px;
            border: red solid 1px;
            margin: 30px auto;
        }
        #curry,#abc{
            float: left;
            height: 185px;
            width: 100px;
            border: gray solid 1px;
            margin: 5px;
            text-align: center;
        }
        #curryimg,#abcimg{
            width: 100px;
            height: 120px;
        }
        .name{
            font-size: 14px;
        }
        .type,.team{
            font-size: 12px;
            color: #70757a;
        }
        .teamimg{
            width: 16px;
            height: 16px;
        }
    </style>
</head>
<body>
    <div id="player">
        <div id="curry">
            <img id="curryimg" src="" alt="">
            <span class="name">名字</span>
            <br>
            <span class="type">位置</span>
            <br>
            <img class="teamimg" src="" alt="">
            <span class="team">队名</span>
        </div>
        <div id="abc">
            <img id="abcimg"src="" alt="">
            <span class="name">名字</span>
            <br>
            <span class="type">位置</span>
            <br>
            <img class="teamimg" src="" alt="">
            <span class="team">队名</span>
        </div>
    </div>
    <p align="center"> &copy; 版权由刘红利归属，未经允许不得复制、镜像</p>
    <script>
        function star(name,type,team,personimg,teamimg){
            this.name=name;
            this.type=type;
            this.team=team;
            this.personimg=personimg;
            this.teamimg=teamimg;
        }
        
        var curry=new star("curry","控球后卫","金州勇士","curry.png","jz.png");
        var abc=new star("字母哥","前锋","密尔沃雄鹿","zmg.png","mew.png");
        document.getElementById("curryimg").src=curry.personimg;
        document.getElementById("abcimg").src=abc.personimg;
        var teamimgitem=document.getElementsByClassName("teamimg");
        teamimgitem[0].src=curry.teamimg;
        teamimgitem[1].src=abc.teamimg;
        var type=document.getElementsByClassName("type");
        type[0].innerHTML=curry.type;
        type[1].innerHTML=abc.type;
        var teamname =document.getElementsByClassName("team");
        teamname[0].innerHTML=curry.team;
        teamname[1].innerHTML=abc.team;
        var nname=document.getElementsByClassName("name");
        nname[0].innerHTML=curry.name;
        nname[1].innerHTML=abc.name;
    </script>
    
</body>
</html>